/*
 * @Author: wangqizhang
 * @Date: 2024-04-26 15:37:48
 * @LastEditors: wangqizhang
 * @LastEditTime: 2024-05-11 10:05:45
 * @FilePath: /suixinji-server/model/group.model.js
 * @Description:
 *
 * Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
 */
const { DataTypes } = require('sequelize');
const seq = require('../db/connect');
const groupParams = {
  group_name: {
    type: DataTypes.STRING,
    allowNull: false,
    unique: true,
    comment: '用户名, 唯一',
    required: true,
  },
  group_icon: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: false,
    comment: '图标',
    required: false,
  },
  group_tag: {
    type: DataTypes.STRING,
    allowNull: true,
    unique: false,
    comment: '分组标签',
    required: false,
  },
  user_id: {
    type: DataTypes.INTEGER,
    allowNull: false,
    unique: false,
    comment: '用户id, 唯一',
    required: false,
  },
};
const Group = seq.define('db_group', groupParams);
Group.sync({ force: false });
module.exports = { Group, groupParams };
